<template>
  <!-- 中医疾病分类统计表 -->
  <div>
    <h1>中医疾病(TCD)分类情况统计表 (一)</h1>
    <h3>时期: {{startDate}} ~ {{endDate}}</h3>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="xh" label="序号" align="center" width></el-table-column>
      <el-table-column prop="zydm " label="中医编码" align="center" width></el-table-column>
      <el-table-column prop="zymc" label="中医疾病名称" align="center" width></el-table-column>
      <el-table-column prop="f1" label="构成比(%)" align="center" width></el-table-column>
      <el-table-column prop="f2" label="出院人数合计" align="center" width></el-table-column>
      <el-table-column label="出院病人数(人)" align="center" width>
        <el-table-column prop="f3" label="合计" align="center" width></el-table-column>
        <el-table-column prop="f4" label="治愈" align="center" width></el-table-column>
        <el-table-column prop="f5" label="好转" align="center" width></el-table-column>
        <el-table-column prop="f6" label="未愈" align="center" width></el-table-column>
        <el-table-column prop="f7" label="死亡" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column prop="f8" label="出院病人占用总床日数" align="center" width></el-table-column>
      <el-table-column prop="f9" label="中医治疗例数" align="center" width></el-table-column>
      <el-table-column label="出院病人住院医疗费用(元)" align="center" width>
        <el-table-column prop="f10" label="总费用" align="center" width></el-table-column>
        <el-table-column label="其中" align="center" width>
          <el-table-column prop="f11" label="服务费" align="center" width></el-table-column>
          <el-table-column prop="f12" label="西药费" align="center" width></el-table-column>
          <el-table-column prop="f13" label="中药费" align="center" width></el-table-column>
          <el-table-column prop="f14" label="手术费" align="center" width></el-table-column>
          <el-table-column prop="f15" label="检查费" align="center" width></el-table-column>
          <el-table-column prop="f16" label="治疗费" align="center" width></el-table-column>
        </el-table-column>
      </el-table-column>
      <el-table-column prop="f17" label="门、出诊断符合数(人)" align="center" width></el-table-column>
      <el-table-column prop="f18" label="入、出诊断符合数(人)" align="center" width></el-table-column>
      <el-table-column prop="f19" label="三日内诊断符合数(人)" align="center" width></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { diseaseSortStatistics } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: "",
      endDate: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        diseaseSortStatistics({
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择开始或结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>